<h2><?php pc_echo(pc_message("login.title")); ?></h2>
<?php pc_pagelet("common/errors");
pc_pagelet("common/messages");
$errors = pc_variable("errors"); ?>
<form method="post" action="dispatcher.php">
    <fieldset class="distinct">
        <span class="required">
            <label for="login.username" class="required"><?php pc_echo(pc_message("field.username")); ?></label>
            <input type="text" id="login.username" name="username" value="<?php pc_echo(pc_variable("username")); ?>"/>
        </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "username")); ?>
        <span class="required">
            <label for="login.password" class="required"><?php pc_echo(pc_message("field.password")); ?></label>
            <input type="password" id="login.password" name="password"/>
        </span>
        <?php pc_pagelet("basic/error", array(
            "errors" => $errors,
            "propertyName" => "password")); ?>
        <span class="check">
            <input type="checkbox" id="login.remember" name="remember"/>
            <label for="login.remember"><?php pc_echo(pc_message("login.remember")); ?></label>
        </span>
    </fieldset>
    <div class="buttons">
        <input type="hidden" name="targetPage.location" value="<?php pc_echo(pc_variable("targetPage.location")); ?>"/>
        <button type="submit" class="login" name="controller" value="Commerce/LogInCustomer"><?php pc_echo(pc_message("login.submit")); ?></button>
    </div>
    <p>
        <?php $targetPageLocation = pc_variable("targetPage.location"); ?>
        <a href="/dispatcher.php?controller=Commerce/StartRegisterCustomer<?php if($targetPageLocation !== null) { pc_echo("&targetPage.location=" . pc_encode_url(pc_variable("targetPage.location"))); } ?>" class="register"><?php pc_echo(pc_message("login.register")); ?></a><br/>
        <a href="/dispatcher.php?controller=Commerce/ResetPassword<?php if($targetPageLocation !== null) { pc_echo("&targetPage.location=" . pc_encode_url(pc_variable("targetPage.location"))); } ?>" class="reset-password"><?php pc_echo(pc_message("login.resetPassword")); ?></a>
    </p>
</form>